package companyuser;

import java.util.HashMap;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class CompanyUserAction extends ActionSupport{
	
	private IUserService iUserService;

	public void setiUserService(IUserService iUserService) {
		this.iUserService = iUserService;
	}

	public String execute() throws Exception {
		if(ServletActionContext.getRequest().getParameter("action")!=null)
			return "companyuserpage";
		else
			return null;
    }
	
	public Map namelist;
	public Map getNamelist() {
		return namelist;
	}
	
	public void setNamelist(Map namelist) {
		this.namelist = namelist;
	}
	
	public String getCompanyUser(){
		String groupid=ServletActionContext.getRequest().getParameter("groupid");
		namelist=new HashMap();
		namelist.put("namelist", iUserService.getUserListByGroupid(groupid));
		return SUCCESS;
	}
	

}
